/**
 *  获取列表信息
 */
export default {
  data() {
    return {
      list: {
        items: [],
        page: 1,
        perPage: 20,
        total: 0,
        isInit: true,
        totalAmount: '',
        amount: {}
      },
      listLoading: true
    };
  },
  methods: {
    fetchData(toPage = 1) {
      this.listLoading = true;
      return this.getList(toPage, this.list.perPage, this.queryData).then(({ data }) => {
        this.list = data;
        this.isInit = false;
        this.list.isInit = false;
        this.listLoading = false;
      }, result => {
        // this.$message({
        //   type: 'error',
        //   message: result.message
        // });
        this.listLoading = false;
      }).catch(e => {
        console.error(e);
      });
    }
  }
};
